package main

import (
	"encoding/json"
	"flag"

	"gitee.com/thubcc/mobile/lte"
	"gitee.com/thubcc/rtlmmap"
	"github.com/prometheus/common/log"
)

var (
	argPort = flag.Int("p", 0, "Rx antana")
)

func main() {
	flag.Parse()
	view := rtlmmap.NewRtlView(*argPort, rtlmmap.DefaultLTEConfig)
	view.Reset()
	rfd := view.Raw(0, 2)
	view.Run(2)
	cid := []int{84, 13, 126, 30}
	rs := lte.NewDlRxFrame(rfd[9600:9600+19200], cid)
	for _, r := range rs {
		data, err := json.Marshal(r)
		if err != nil {
			log.Info(err)
		}
		log.Info(string(data))
	}
	// tab := lte.GetCRSTable(84, 0)
	// tab.Dump()
}
